package com.dc.gameserver.extComponents.ehcache.Icache;


import com.dc.gameserver.extComponents.ehcache.CacheException;

/**
 * Created with IntelliJ IDEA.
 * User: CLINUX
 * Date: 12-11-25
 * Time: 下午8:26
 * To change this template use File | Settings | File Templates.
 *
 */
public interface CacheProvider {

    /**
     * Configure the cache
     *
     * @param cachename the name of the cache region
     * @param autoCreate autoCreate settings
     * @param autoCreate autoCreate settings
     * @throws com.dc.gameserver.extComponents.ehcache.CacheException
     */
    public Cache buildCache(String cachename, boolean autoCreate) throws CacheException;

    /**
     * Callback to perform any necessary initialization of the underlying cache implementation
     * during SessionFactory construction.
     *
     */
    public void registerMemoryStore() throws CacheException;

    /**
     * Callback to perform any necessary cleanup of the underlying cache implementation
     * during SessionFactory.close().
     */
    public void shutdown();

}

